<?php
/**
 * 文件管理
 * $Id: manage_files.php 230 2010-12-15 02:25:40Z bwanglei@gmail.com $
 */

require_once './globals.php';
require_once AW_ROOT.'/model/class.file.php';
$aw_file = new awFile();	//创建文件对象
$blog_title = '管理文件 - '.$blogname;	//设置页面标题

//删除文件
if ($_SERVER['REQUEST_METHOD']=='POST' && $action=='del') {
	$id_del = $_POST['id_file'];
	$aw_file->delete_file($id_del);
	header('Location: '.$_SERVER['REQUEST_URI']);exit;
}
//取得当前的数据
$bookmark = isset($_GET['b']) ? $_GET['b'] : '';
$result = $aw_file->get_files($bookmark);
$files = $result[0];
//设置上一页和下一页的bookmark
$pre_bookmark = $result[1];
$next_bookmark = $result[2];

//包含模版文件
include_once TEMPLATE_PATH.'/header.php';
include_once TEMPLATE_PATH.'/manage_files.php';
include_once TEMPLATE_PATH.'/sidebar.php';
include_once TEMPLATE_PATH.'/footer.php';
